<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Site Manager</title>
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/reset.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/text.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/grid.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/layout.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/nav.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/custom.css" media="screen" />
        <!--[if IE 6]><link rel="stylesheet" type="text/css" href="../css/ie6.css" media="screen" /><![endif]-->
        <!--[if IE 7]><link rel="stylesheet" type="text/css" href="../css/ie.css" media="screen" /><![endif]-->
    </head>
    <body >
        <div class="container_16" >

            <?php include 'admin_header.php'; ?>

            <!-- Left Menu Panel !-->

            <?php include 'admin_left_menu.php'; ?>


            <!-- Content Panel -->	
            <div class="grid_7">
                <div class="box">
                    <h2>
                        <a href="#" id="toggle-tables">NEWS MANAGEMENT : </a>
                    </h2>
                    <div class="block" >
                        <form name="admin-form" action="<?= base_url(); ?>admin/news/news_update_insert" method="post">
                            <fieldset>
                                <legend>Update : News </legend>
                                <?php
                                if ($this->session->flashdata('message')) {
                                    $msg = $this->session->flashdata('message');
                                    echo '<font color="red">' . $msg . '</font>';
                                }
                                ?> 
                                <div class="field">
                                    <label> News Title</label>
                                    <input type="text" size="165%" name="newstitle" value="<?= $update_news->title;?>"/>
                                </div>
                                <div class="field">
                                    <label> News Description</label>
                                    <textarea rows="3" cols="105" name="newsdescription" ><?= $update_news->description;?></textarea>
                                    <input type="hidden" name="id" value="<?= $update_news->id;?>"/>
                                </div>
                                <div class="field">
                                    <label> Meta Title</label>
                                    <input type="text" size="165%" name="metatitle" value="<?= $update_news->meta_title;?>"/>
                                </div>
                                <div class="field">
                                    <label> News Title</label>
                                    <textarea rows="2" cols="105" name="metakeyword" ><?= $update_news->meta_keyword;?></textarea>
                                </div>
                                <div class="field">
                                    <label> News Title</label>
                                    <textarea rows="3" cols="105" name="metadescription" ><?= $update_news->meta_description;?></textarea>
                                </div>
                                <input type="submit" value=" Update" name="submitnews" />
                            </fieldset>
                        </form>
                    </div>
                </div> <!-- END OF BOX -->
                <div class="box">
                    <h2>
                        <a href="#" id="toggle-tables">NEWS LIST : </a>
                    </h2>
                    <div class="block" >
                       <fieldset>
                                <legend>News </legend> 
                                <?php foreach($news as $news):?>
                                 <div class="field" style="border-bottom:2px solid #fff; width:auto;padding:5px 0 2px 0; ">
                                  <div style="width:80px;float:left; margin-right:15px; "><?= $news->date; ?></div>
                                   <?= $news->title; ?>
                                   <div style="float:right;">
                                       <a href="<?= base_url(); ?>admin/news/update_news/<?= $news->id; ?>" class="link-button" style="margin-left: 100px;"   onclick="return confirm('Are you sure you want to Update?')"> View </a>
                                       <a href="<?= base_url(); ?>admin/news/delete_news/<?= $news->id; ?>" class="link-button"  onclick="return confirm('Are you sure you want to Delete?')"> Delete </a></div>
                                </div>
                                <?php endforeach;?>
                    </fieldset>
                    </div>
                    <div class="pagination" align="left"> <?php echo $this->pagination->create_links(); ?>  </div>
                </div>
            </div>
            <div class="grid_16" id="site_info">
                <div class="box">
                    <p><?= $this->settings_model->get_setting('webtitle'); ?></p>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <script type="text/javascript" src="<?= base_url(); ?>js/admin/mootools-1.2.1-core.js"></script>
        <script type="text/javascript" src="<?= base_url(); ?>js/admin/mootools-1.2-more.js"></script>
        <script type="text/javascript" src="<?= base_url(); ?>js/admin/mootools-fluid16-autoselect.js"></script>
    </body>
</html>